DisplayCutoutCompat

constructor(@Nullable safeInsets: Rect, @Nullable boundingRects: List<Rect>)(source)

Creates a DisplayCutout instance.

Parameters

safeInsets

the insets from each edge which avoid the display cutout as returned by getSafeInsetTop etc.

boundingRects

the bounding rects of the display cutouts as returned by getBoundingRects ()}.


constructor(@NonNull safeInsets: Insets, @Nullable boundLeft: Rect, @Nullable boundTop: Rect, @Nullable boundRight: Rect, @Nullable boundBottom: Rect, @NonNull waterfallInsets: Insets)(source)

Creates a DisplayCutout instance.

Parameters

safeInsets

the insets from each edge which avoid the display cutout as returned by getSafeInsetTop etc.

boundLeft

the left bounding rect of the display cutout in pixels. If null is passed, it's treated as an empty rectangle (0,0)-(0,0).

boundTop

the top bounding rect of the display cutout in pixels. If null is passed, it's treated as an empty rectangle (0,0)-(0,0).

boundRight

the right bounding rect of the display cutout in pixels. If null is passed, it's treated as an empty rectangle (0,0)-(0,0).

boundBottom

the bottom bounding rect of the display cutout in pixels. If null is passed, it's treated as an empty rectangle (0,0)-(0,0).

waterfallInsets

the insets for the curved areas in waterfall display.


constructor(@NonNull safeInsets: Insets, @Nullable boundLeft: Rect, @Nullable boundTop: Rect, @Nullable boundRight: Rect, @Nullable boundBottom: Rect, @NonNull waterfallInsets: Insets, @Nullable cutoutPath: Path)(source)

Creates a DisplayCutout instance.

Parameters

safeInsets

the insets from each edge which avoid the display cutout as returned by getSafeInsetTop etc.

boundLeft

the left bounding rect of the display cutout in pixels. If null is passed, it's treated as an empty rectangle (0,0)-(0,0).

boundTop

the top bounding rect of the display cutout in pixels. If null is passed, it's treated as an empty rectangle (0,0)-(0,0).

boundRight

the right bounding rect of the display cutout in pixels. If null is passed, it's treated as an empty rectangle (0,0)-(0,0).

boundBottom

the bottom bounding rect of the display cutout in pixels. If null is passed, it's treated as an empty rectangle (0,0)-(0,0).

waterfallInsets

the insets for the curved areas in waterfall display.

cutoutPath

the path of the display cutout. Specifying a path with this constructor is only supported on API 33 and above, even though a real DisplayCutout can have a cutout path on API 31 and above. On API 32 and below, this path is ignored.